package com.suineg.pms.entity.base;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.suineg.pms.entity.IdEntity;
import com.suineg.pms.entity.User;

/**
 * 车库实体
 *@author Suine
 */
@Entity
@Table(name = "pms_barn")
public class Barn extends IdEntity{
	/** 车库编号  */
	private String no;
	/** 位置 */
	private	String location;
	/** 状态  */
	private Integer status;
	/** 操作人 */
	private User opuser;
	/** 操作时间 */
	private Date opdate;
	/** 小区 */
	private Community community;
	/** 楼栋 */
	private Building building;
	public String getNo() {
		return no;
	}
	public void setNo(String no) {
		this.no = no;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	public User getOpuser() {
		return opuser;
	}
	public void setOpuser(User opuser) {
		this.opuser = opuser;
	}
	public Date getOpdate() {
		return opdate;
	}
	public void setOpdate(Date opdate) {
		this.opdate = opdate;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "community_id")
	public Community getCommunity() {
		return community;
	}
	public void setCommunity(Community community) {
		this.community = community;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "building_id")
	public Building getBuilding() {
		return building;
	}
	public void setBuilding(Building building) {
		this.building = building;
	}
	@Override
	public String toString() {
		return "Barn [no=" + no + ", location=" + location + ", status=" + status + ", opuser=" + opuser + ", opdate=" + opdate + ", community=" + community + ", building="
				+ building + "]";
	}
	public Barn() {
		super();
		// TODO Auto-generated constructor stub
	}
}

